# Replication Package
___
>Smith, Daniel Scott. (2022, _revise + resubmit_). The Making of the Modern State: Social Scientization and Education Legislation in the United Kingdom, 1800–1914. _European Journal of Sociology_.

## Getting Started
___
### Download this Package
Download the "00_replication" directory. Note its location on your local machine, for example by copying its pathname.

### Software Requirements
This packages uses Stata to model and visualize the data and Python to wrangle the data:
* Stata (version 16 or higher)
* Python (version 3.8)

### Installation 
* Stata must be first __[purchased](https://www.stata.com/)__ and installed to run its `.do` files. Results can be reproduced by hand using alternative software, such as Python and R. Respective code is not included in this package.
* Python and the relevant libraries used in these analyses can be installed by executing the following on the command line:

  ```sh
  cd <path to 00_replication>
  ```
  ```sh
  conda create --name ejs --file requirements.txt
  ```

## Steps to Reproduce Results 
___
Once all required software is installed, follow these steps to reproduce all data and results:

* Activate the virtual conda environment and initialize the jupyter server (will launch in browser):

  ```sh
  conda activate ejs
  ```
  ```sh
  jupter lab
  ```
* From within the jupyter lab interface, open each jupyter notebooks (cr_*.ipynb) and execute all their respective cells by clicking the `>>` button in the toolbar. 
  * Each notebook is annotated, so data-analytic steps can be easily followed.
  * For convenience, all data is already contained in this directory, so this step can be skipped.
* Open the Stata app. Excute the following __on the Stata command line__:
    ```
    cd <path to 00_replication>
    ```
    ```
    do main <path to 00_replication> 
    ```
    * All `.do` files in the 01_scripts subdirectory are annotated, so data-analytic steps can be easily followed.
    * All reproduced results will populate the 02_visuals subdirectory. (They are preincluded as convenience.)

___
Daniel Scott Smith, 10/8/22